package homework2;

import java.util.Arrays;
import java.util.Comparator;

/**
 *库存排序
 */
public class StockProductSort implements ProductSort {
    @Override
    public void sort(Product[] products) {
        Arrays.sort(products, Comparator.comparingInt(Product::getStock).reversed());
    }
}